<?php
	class User_model extends CI_Model {
		private $table_name="user";
	    public function get_one($name,$pass)
	    {	
	    	$array=array("username"=>$name,"password"=>$pass);
	        $query = $this->db->where($array)->get($this->table_name);
	        return $query->row();
	    }
	    public function get_all_username($username)
	    {
	    	$query=$this->db->select("username")->where('username',$username)->get($this->table_name);
	    	return $query->result();
	    }
	     public function add_user($name,$pass)
	    {
	    	$query=$this->db->insert($this->table_name,array(
	    		'username'=>$name,
	    		'password'=>md5($pass),
	    		'creat_time'=>time()
	    		));
	    }
   
}

    
